<?php
class HomePage extends Page 
{

}

class HomePage_Controller extends Page_Controller 
{
    public function ResidentNews($num=5)
    {
        $news = ResidentNews::get()->where("NewsStatus = '" . Globals::STATUS_ACTIVE . "' AND Expires > NOW() AND StartOn <= NOW()")->sort("StartOn DESC, ID DESC")->limit($num);
        return $news;
    }
}